{% extends "base.html" %}

{% load i18n %}

{% block title %}
    {% if address_form.instance.pk %}
        {% trans "Edit address" context "Edit address page title" %}
    {% else %}
        {% trans "New address" context "New address page title" %}
    {% endif %} — {{ block.super }}{% endblock %}

{% block breadcrumb %}
  <ul class="breadcrumbs list-unstyled">
    <li><a href="/">
        {% trans "Home" context "Main navigation item" %}
    </a></li>
    <li><a href="{% url "profile:details" %}">
        {% trans "Your profile" context "Edit/new address breadcrumb" %}
    </a></li>
    {% if address_form.instance.pk %}
        <li><a href=".">
            {% trans "Edit address" context "Edit address breadcrumb" %}
        </a></li>
    {% else %}
        <li><a href=".">
            {% trans "New address" context "New address breadcrumb" %}
        </a></li>
    {% endif %}
  </ul>
{% endblock breadcrumb %}

{% block content %}
<div class="row userprofile__address-edit">
    <div class="col-sm-8 col-lg-6 offset-sm-2 offset-lg-3">
        <form method="post" novalidate>
            {% csrf_token %}
            <h2 class="text-center">
              {% if address_form.instance.pk %}
                {% trans "Edit address" context "Edit address title" %}
              {% else %}
                {% trans "New address" context "New address title" %}
              {% endif %}
            </h2>
            <div class="userprofile__address-edit__form">
              {% include "userprofile/snippets/address-form.html" %}
            </div>
            <p class="text-right">
                <button type="submit" class="btn primary narrow">
                    {% trans "Save changes" context "Edit/new address primary action" %}
                </button>
            </p>
        </form>
    </div>
</div>
{% endblock content %}
